home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93c.txt / 000013_icon-group-sender _Tue Jul 20 10:03:18 1993.msg < prev    next >
Internet Message Format  |  1994-02-02  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Tue, 20 Jul 1993 13:43:46 MST
  2. Message-Id: <9307201701.AA31350@enlil.premenos.sf.ca.us>
  3. From: Ken Walker <kwalker@shara.premenos.sf.ca.us>
  4. Subject: Re: Mystery about "every"
  5. To: icon-group@cs.arizona.edu
  6. Date: Tue, 20 Jul 93 10:03:18 PDT
  7. In-Reply-To: <705767@MTS.cc.Wayne.edu>; from "Paul_Abrahams@MTS.cc.Wayne.edu" at Jul 20, 93 11:00 am
  8. Mailer: Elm [revision: 66.25]
  9. Status: R
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. > Paul_Abrahams@MTS.cc.Wayne.edu writes 
  13. >  
  14. > ...
  15. > This program produced the output 83, as expected.  But I then replaced
  16. > the "every" statement by the following one, which I thought to be more
  17. > elegant:
  18. >  
  19. >    every retval :=  8 * retval + ord(!s) - ord("0")
  20. >  
  21. > Now the output of the program is 3 (the last digit), not 83.
  22.  
  23. Backtracking only goes as far as the generator !s. The expression
  24.  
  25.    8 * retval
  26.  
  27. is not reeveluated. The original value of 0 is used in every
  28. iteration.
  29.  
  30.    Ken Walker, kwalker@premenos.sf.ca.us
  31.